/*    */
package com.iris.egrant.app.dao.proposal;
/*    */
/*    */

import com.iris.egrant.app.model.proposal.CollectReportExtend;
import com.iris.egrant.exception.DaoException;
import com.iris.egrant.model.proposal.Proposal;
import com.iris.egrant.orm.hibernate.HibernateDao;
import org.hibernate.SQLQuery;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
@Repository
/*    */ public class ProposalAppDao
        /*    */ extends HibernateDao<Proposal, Long>
        /*    */ {
    /*    */
    /*    */
    /*    */
    /*    */
    public CollectReportExtend queryCollectReportExtend(Long idRaq) {
        /* 65 */
        String hql = "from CollectReportExtend p where p.idRaq = ?";
        /* 66 */
        List<CollectReportExtend> list = createQuery(hql, new Object[]{idRaq}).list();
        /* 67 */
        CollectReportExtend pre = new CollectReportExtend();
        /* 68 */
        Iterator<CollectReportExtend> it = list.iterator();
        /* 69 */
        while (it.hasNext()) {
            /* 70 */
            pre = it.next();
            /*    */
        }
        /* 72 */
        return pre;
        /*    */
    }

    /*    */
    /*    */
    public int findTechInfo(int flag, String param) throws DaoException {
        /* 76 */
        List<Object> paramsList = new ArrayList();
        /* 77 */
        paramsList.add(Integer.valueOf(flag));
        /* 78 */
        paramsList.add(param);
        /* 79 */
        SQLQuery sQLQuery = createSqlQuery("select * from tech_award_info where type=? and content=? ", paramsList);
        /*    */
        /*    */
        /* 82 */
        sQLQuery.setReadOnly(true);
        /* 83 */
        return sQLQuery.list().size();
        /*    */
    }

    /*    */
    /*    */
    public int sciencePsnCardCodeCheck(long psoCode, String param) {
        /* 87 */
        List<Object> paramsList = new ArrayList();
        /* 88 */
        paramsList.add(param);
        /* 89 */
        SQLQuery sQLQuery = createSqlQuery("select count(0) from proposal_persons pp left join proposal prp on pp.prp_code = prp.prp_code  where pp.card_code = ? and prp.grant_code = '916'  and prp.stat_year = to_char(sysdate, 'yyyy') and prp.status not in (10,99,00)  and pp.is_pc=1", paramsList);
        /*    */
        /*    */
        /*    */
        /*    */
        /*    */
        /*    */
        /* 96 */
        int resutl = Integer.parseInt((new StringBuilder()).append(sQLQuery.list().get(0)).append("").toString());
        /* 97 */
        return resutl;
        /*    */
    }
    /*    */
}


/* Location:              D:\文件\123\WEB-INF\classes\!\com\iris\egrant\app\dao\proposal\ProposalAppDao.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.1.3
 */